import QQMapWX from '../unity/qqmap-wx-jssdk.min'
var qqmapsdk = new QQMapWX({
  key: 'EBDBZ-F3UWS-E23OU-6DDCG-DKN5J-IJFJA'
});

function toObtainPosition(latitude, longitude) {
  return new Promise((resolve, reject) => {
    qqmapsdk.reverseGeocoder({
      location: {
        latitude: latitude,
        longitude: longitude
      },
      success(res) {
        resolve(res.result.address_component)
      },
      fail(res) {
        console.log(res)
      }
    })
  })
}
module.exports = {
  toObtainPosition: toObtainPosition
}